:root {
    /* 主色调 */
    --primary-color: #4361ee;
    --primary-light: #738bff;
    --primary-dark: #2b4acb;

    /* 辅助色 */
    --secondary-color: #7209b7;
    --secondary-light: #9d4eda;
    --secondary-dark: #5a0591;

    /* 功能色 */
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;

    /* 中性色 */
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
}

/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    border-radius: 4px;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: white;
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 100%;
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 700;
}

.nav-item.active::after {
    width: 100%;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.feature-section {
    display: none;
    padding: 1rem;
    border-radius: 8px;
    animation: fadeIn 0.5s ease;
}

.feature-section.active {
    display: block;
}

.feature-section h2 {
    margin-bottom: 1.5rem;
}

/* 上传区域 */
.upload-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.upload-box {
    position: relative;
    border: 2px dashed var(--gray-300);
    padding: 3rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    background-color: white;
}

.upload-box input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-box svg {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.preview-box {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.controls-panel {
    padding: 1rem;
    background-color: white;
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* 按钮样式 */
.btn-primary, .btn-secondary {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background-color: white;
    z-index: 150;
    transition: right 0.3s ease;
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.sidebar-header h3 {
    margin: 0;
}

.sidebar-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-content {
    padding: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--gray-700);
}

.sidebar-item:hover {
    background-color: var(--gray-100);
}

.sidebar-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 140;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 工具类 */
.hidden {
    display: none;
}

/* 调整用户信息显示样式 */
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;  /* 调整间距 */
    margin-top: -2px;  /* 向上微调位置 */
}

#userLoggedIn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#userInfo {
    color: white;  /* 确保文字为白色 */
    opacity: 1;    /* 调整不透明度为1，使文字更清晰 */
    font-weight: 500;  /* 稍微加粗字体 */
    font-size: 1rem;  /* 调整字体大小 */
    padding: 0.25rem 0;  /* 增加一些内边距 */
}